/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hxg.portmgr.core.oper.snmp.oidgroup;

import hxg.portmgr.core.oper.snmp.param.Param;
import org.snmp4j.smi.OID;

/**
 *
 * @author hxg
 */
public enum IfOID implements OidEntry, Param {

    ifIndex(new OID("1.3.6.1.2.1.2.2.1.1")) {
        @Override
        public String chsname() {
            return "接口索引";
        }

        @Override
        public RemoteValueType remoteValueType() {
            return RemoteValueType.NumberValue;
        }
    },
    ifName(new OID("1.3.6.1.2.1.31.1.1.1.1")) {
        @Override
        public String chsname() {
            return "接口名称";
        }

        @Override
        public RemoteValueType remoteValueType() {
            return RemoteValueType.StringValue;
        }
    },
    ifDesc(new OID("1.3.6.1.2.1.2.2.1.2")) {
        @Override
        public String chsname() {
            return "接口描叙";
        }

        @Override
        public RemoteValueType remoteValueType() {
            return RemoteValueType.StringValue;
        }
    },
    ifType(new OID("1.3.6.1.2.1.2.2.1.3")) {
        @Override
        public String chsname() {
            return "接口描叙";
        }

        @Override
        public RemoteValueType remoteValueType() {
            return RemoteValueType.NumberValue;
        }
    },
    ifMtu(new OID("1.3.6.1.2.1.2.2.1.4")) {
        @Override
        public String chsname() {
            return "接口MTU";
        }

        @Override
        public RemoteValueType remoteValueType() {
            return RemoteValueType.NumberValue;
        }
    },
    ifSpeed(new OID("1.3.6.1.2.1.2.2.1.5")) {
        @Override
        public String chsname() {
            return "接口速率";
        }

        @Override
        public RemoteValueType remoteValueType() {
            return RemoteValueType.NumberValue;
        }
    },
    ifAdminState(new OID("1.3.6.1.2.1.2.2.1.7")) {
//可set参数 up 1 down 2     
        @Override
        public String chsname() {
            return "接口管理状态";
        }

        @Override
        public RemoteValueType remoteValueType() {
            return RemoteValueType.NumberValue;
        }
    },
    ifOperState(new OID("1.3.6.1.2.1.2.2.1.8")) {
//up(1),down(2),testing(3),unknown(4),dormant(5),notPresent(6),lowerLayerDown(7)
        @Override
        public String chsname() {
            return "接口操作状态";
        }

        @Override
        public RemoteValueType remoteValueType() {
            return RemoteValueType.NumberValue;
        }
    }, ifLastChange(new OID("1.3.6.1.2.1.2.2.1.9")) {
//up(1),down(2),testing(3),unknown(4),dormant(5),notPresent(6),lowerLayerDown(7)
        @Override
        public String chsname() {
            return "最后状态变化时间";
        }

        @Override
        public RemoteValueType remoteValueType() {
            return RemoteValueType.NumberValue;
        }
    };

    private IfOID(OID oid) {
        this.oid = oid;
    }
    final OID oid;

    @Override
    public OID getOID() {
        return oid;
    }

    @Override
    public String oidValue() {
        return oid.toString();
    }

    @Override
    public abstract String chsname();

    @Override
    public String unit() {
        return "";
    }

    @Override
    public abstract RemoteValueType remoteValueType();

    @Override
    public String toString() {
        return chsname();
    }

    @Override
    public OID getAppendOID(OID appendOid) {
        return (new OID(oid)).append(appendOid);
    }

    @Override
    public Param getParamType() {
        return this;
    }
}
